package com.villaday.idf.adapter;

import android.content.Context;
import android.view.View;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.base.OnAdapterCallbackListener;
import com.villaday.idf.model.RecommendEntity;
import com.villaday.idf.model.RefreshtokenEntity;
import com.villaday.idf.model.TopicEntity;
import com.villaday.idf.util.PhoneUtil;
import com.villaday.idf.util.SharedPreferencesUtil;

/**
 * 首页动态列表
 */

public class HomeDetailsSameAdapter extends AbsRecyclerViewAdapter<TopicEntity.BodyEntity.SimilarHouseListEntity> {
    private OnAdapterCallbackListener onAdapterCallbackListener;
    private View.OnClickListener onClickListener;
/*
    private final String roleType;
*/

    public HomeDetailsSameAdapter(Context context) {
        super(context, R.layout.item_homedetails_same, R.layout.item_page_loading,
                R.layout.item_page_bottom);
       
       /* RefreshtokenEntity.BodyBean roleInfo =
                SharedPreferencesUtil.getRoleInfo(context);
        roleType = roleInfo.getMember().getType();*/

    }
    

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, TopicEntity.BodyEntity.SimilarHouseListEntity d, int position) {
        holder.bindSimpleDraweeView(R.id.sdv,d.getImageURL())
                .bindTextView(R.id.tv_title,d.getName())
                .bindTextView(R.id.detail,d.getLocation().getProvince()+"·"+d.getLocation().getCity())
                .bindTextViewWithHtml(R.id.tv_price,"&yen;" + (d.getOriginalPrice() == 0 ? "0.00" : PhoneUtil.handleBalance(d.getOriginalPrice() / 100.0 + "", 0)));






    }
}
